<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'userList.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<script type="text/javascript">
function del(){
if(confirm("确认删除?")){
return true;
}
return false;
}
</script>
	</head>

	<body>
	
		<s:action name="userListAction"></s:action>
		<h1 align="center">
			<font color="red">Users List</font>
		</h1>
		<table align="center" border="1">
			<tr>
				<td>
					序号
				</td>
				<td>
					姓
				</td>
				<td>
					名
				</td>
				<td>
					年龄
				</td>
				<td>
					删除
				</td>
				<td>
					更新
				</td>
			</tr>
			<s:iterator value="#request.list" id="user">
				<tr>
					<td>
						<s:property value="#user.id" />
					</td>
					<td>
						<s:property value="#user.firstname" />
					</td>
					<td>
						<s:property value="#user.lastname" />
					</td>
					<td>
						<s:property value="#user.age" />
					</td>
					<td>
						<s:a href="userDeleteAction.action?user.id=%{#user.id}" onclick="return del();">删除</s:a>
					</td>
					<td>
						<s:a href="userPUpdateAction.action?user.id=%{#user.id}">更新</s:a>
					</td>


				</tr>
			</s:iterator>

		</table>
		<h3 align="center">
			<s:a href="generateExcelAction.action"> 生成EXCEL文件</s:a>
		</h3>
	</body>
</html>
